execute as @n[tag=VoidShop,type=marker,distance=..10] at @s run data modify entity @s data.LastSlotIndex set from entity @n[tag=VoidShop.slot,distance=..10,type=item_display,nbt={item:{components:{"minecraft:custom_data":{VoidShopSlot:{id:9}}}}}] item.components."minecraft:custom_data".VoidShopSlot.Index
scoreboard players reset #index temp
scoreboard players reset #slot temp
data remove storage vs:system temp.VS